﻿
<ribbon:RibbonWindow  x:Class="XWord.GUI.Views.TestView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared" 
	xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon" 
    ApplicationName="RibbonWindow1" Width="620" Height="420">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <RichTextBox x:Name="editor" Grid.Row="1" Margin="7" AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Visible">
            <RichTextBox.Resources>
                <!-- Make the scroll viewer in the RichTextBox use the custom scrollbar style -->
                <Style TargetType="ScrollViewer" BasedOn="{StaticResource {x:Static ribbon:RibbonStyles.ScrollViewerAlternateKey}}" />
            </RichTextBox.Resources>

            <FlowDocument>
                <Paragraph Foreground="Navy" FontWeight="Bold" FontSize="{DynamicResource {x:Static SystemFonts.CaptionFontSizeKey}}">Starter Template</Paragraph>
                <Paragraph>
                    Modify this RibbonWindow as needed to customize it to your specifications.
                </Paragraph>
            </FlowDocument>
        </RichTextBox>

        <!-- Ribbon Control (Define last so that adorners overlay other controls) -->
        <ribbon:Ribbon x:Name="ribbon" Grid.Row="0">

            <!-- Tab Panel Items (Appear next to the tabs) -->
            <ribbon:Ribbon.TabPanelItems>
                <ribbon:Button Label="Help" KeyTipAccessText="Z" />
            </ribbon:Ribbon.TabPanelItems>

            <ribbon:Ribbon.ApplicationMenu>
                <!-- Application Menu -->
                <ribbon:ApplicationMenu>

                    <!-- Application Menu Items -->
                    <ribbon:Button Label="New" KeyTipAccessText="N" />
                    <ribbon:Button Label="Open" KeyTipAccessText="O" />
                    <ribbon:Button Label="Save" KeyTipAccessText="S" />
                    <ribbon:Button Label="Save As" KeyTipAccessText="A" />
                    <ribbon:Separator />
                    <ribbon:Button Label="Print" KeyTipAccessText="P" />
                    <ribbon:Separator />
                    <ribbon:Button Label="Close" KeyTipAccessText="C" />

                    <!-- Additional Content (Right side of application menu) -->
                    <ribbon:ApplicationMenu.AdditionalContent>
                        <ribbon:RecentDocumentMenu>
                            <shared:RecentDocumentManager x:Name="recentDocManager" />
                        </ribbon:RecentDocumentMenu>
                    </ribbon:ApplicationMenu.AdditionalContent>

                    <!-- Application Menu Footer Buttons -->
                    <ribbon:ApplicationMenu.FooterButtons>
                        <ribbon:Button Label="Options" KeyTipAccessText="I" />
                        <ribbon:Button Label="Exit Application"  KeyTipAccessText="X" />
                    </ribbon:ApplicationMenu.FooterButtons>
                </ribbon:ApplicationMenu>
            </ribbon:Ribbon.ApplicationMenu>

            <!-- Quick Access ToolBar (QAT) -->
            <ribbon:Ribbon.QuickAccessToolBarItems>
            </ribbon:Ribbon.QuickAccessToolBarItems>

            <!-- Tabs -->
            <ribbon:Ribbon.Tabs>

                <ribbon:Tab Label="Home" KeyTipAccessText="H">
                    <ribbon:Group Label="New Group">
                        <ribbon:RibbonGallery ItemsSource="{Binding AlphabetList}">
                           
                            <ribbon:RibbonGallery.ItemTemplate>
                                <DataTemplate>
                                    
                                    <ribbon:Button Label="{Binding Name}" x:Name="aa" Height="20" Width="38" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">

                                        <ribbon:Button.ToolTip>
                                            <StackPanel MaxWidth="400">
                                                <WrapPanel>
                                                    <TextBlock Text="词源："></TextBlock>
                                                    <TextBlock Text="{Binding Etymon}" TextWrapping="Wrap"></TextBlock>
                                                </WrapPanel>
                                                <WrapPanel>
                                                    <TextBlock Text="发音规则："></TextBlock>
                                                    <TextBlock Text="{Binding PronounceRule}" TextWrapping="Wrap"></TextBlock>
                                                </WrapPanel>
                                            </StackPanel>
                                        </ribbon:Button.ToolTip>
                                    </ribbon:Button>
                                </DataTemplate>
                            </ribbon:RibbonGallery.ItemTemplate>
                        </ribbon:RibbonGallery>

                    </ribbon:Group>
                </ribbon:Tab>

                <ribbon:Tab Label="Another Tab" />
            </ribbon:Ribbon.Tabs>

        </ribbon:Ribbon>
    </Grid>

    <!-- Status bar is defined in the RibbonWindow.StatusBar property so that it takes over as the window's bottom border -->
    <ribbon:RibbonWindow.StatusBar>
        <!-- StatusBar Control (Is the normal WPF control but with styling) -->
        <StatusBar FocusManager.IsFocusScope="True">
            <StatusBar.ItemsPanel>
                <ItemsPanelTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                    </Grid>
                </ItemsPanelTemplate>
            </StatusBar.ItemsPanel>

            <!--<StatusBarItem Grid.Column="0" Padding="3,0,0,0">
                <ribbon:Button Context="StatusBarItem" Padding="6,0,6,0" Label="Clickable Label" 
				   ScreenTipHeader="This label is actually a button that can be clicked." />
            </StatusBarItem>
            <Separator Grid.Column="1" />
            <StatusBarItem Grid.Column="2" />
            <Separator Grid.Column="3" Style="{StaticResource {x:Static ribbon:RibbonStyles.StatusBarSeparatorAlternateKey}}" />
            <StatusBarItem Grid.Column="3" Padding="4,0,4,0" Style="{StaticResource {x:Static ribbon:RibbonStyles.StatusBarItemAlternateKey}}">
                <TextBlock Text="(View controls here)" />
            </StatusBarItem>-->
            <Button Content="xxx">
                <Button.ToolTip>
                    <CheckBox Loaded="CheckBox_Loaded"></CheckBox>
                </Button.ToolTip>
            </Button>
        </StatusBar>
    </ribbon:RibbonWindow.StatusBar>
</ribbon:RibbonWindow>
